package com.eternallove.api.system;

import com.eternallove.api.BaseController;
import com.eternallove.core.annotation.pr.PreventRepeat;
import com.eternallove.core.model.ApiResponse;
import com.eternallove.core.model.PageWrap;
import com.eternallove.core.model.PageData;
import com.eternallove.dao.system.dto.QuerySystemJobLogDTO;
import com.eternallove.dao.system.model.SystemJobLog;
import com.eternallove.service.system.SystemJobLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;    
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Eva.Caesar Liu
 * @since 2022/11/30 15:45
 */
@Api(tags = "系统定时任务日志")
@RestController
@RequestMapping("/system/job/log")
public class SystemJobLogController extends BaseController {

    @Autowired
    private SystemJobLogService systemJobLogService;

    @ApiOperation("分页查询")
    @PostMapping("/page")
    @RequiresPermissions("system:job:log:query")
    public ApiResponse<PageData<SystemJobLog>> findPage (@RequestBody PageWrap<QuerySystemJobLogDTO> pageWrap) {
        return ApiResponse.success(systemJobLogService.findPage(pageWrap));
    }
}
